//  群成员表
// 字段说明
// id, 群ID 用户ID 群名称，加入时间，未读消息，是否屏蔽群（0不屏蔽，1屏蔽）


const mongoose = require('mongoose'); //导入
const Schema = mongoose.Schema(); //创建集合字段
const user = require('./user');
const friendGroup = require('./friendGroup');



let groupUserSchema = new Schema({

  groupId: {
    type: Schema.Schema.Types.ObjectId,
    ref: friendGroup
  },
  userId: {
    type: Schema.Schema.Types.ObjectId,
    ref: user
  },
  friendGroupName: String,
  creationTime: Date,
  affiche: String,
  imgUrl: String,


})



let groupUser = mongoose.model('groupUser', groupUserSchema)

module.exports = groupUser; //群成员